import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/layout'
  },
  {
    path: '/login',
    component: () => import('@/views/login')
  },
  {
    path: '/layout',
    component: () => import('@/views/layout'),
    children: [
      {
        path: '',
        redirect: 'home'
      },
      {
        path: 'home',
        component: () => import('@/views/layout/home')
      },
      {
        path: 'my',
        component: () => import('@/views/layout/my')
      },
      {
        path: 'like',
        component: () => import('@/views/layout/Like')
      },
      {
        path: 'collect',
        component: () => import('@/views/layout/collect')
      }]
  },
  {
    path: '/detail/:id',
    component: () => import('@/views/layout/articalDetail')
  },

  { path: '/404', component: () => import('@/views/404') }
]

const router = new VueRouter({
  routes
})

export default router
